package com.tedu.com.tedu;

import java.util.Arrays;

public class pratice {
    public static void main(String[] args) {
        String x = "string";
        String y = "string";
        String z = new String();

//        System.out.println(x==y);
//        System.out.println(x==z);
//
//        System.out.println("x=:"+x);
//        System.out.println("y=:"+y);
//        System.out.println("z=:"+z);
//        System.out.println(x.equals(y));
//        System.out.println(x.equals(z));
//        System.out.println(x.hashCode());
//        System.out.println(y.hashCode());
//        System.out.println(z.hashCode());


        Cat c1 = new Cat("王磊");
        Cat c2 = new Cat("王磊");
        System.out.println(c1.equals(c2));
        System.out.println(c1==c2);


    }
}

class Cat {
    public Cat(String name) {
        this.name = name;
    }

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}



